]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: Fix conflicting session notification
authorJoan Torres <joan.torres@suse.com>
Wed, 13 Mar 2024 10:17:24 +0000 (11:17 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Mar 2024 17:32:28 +0000 (17:32 +0000)
The internal notification API changed between the time the
code was originally written and the time the change was
merged. Belatedly adapt to those changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3236>

js/gdm/loginDialog.js

index 28db1a9deff8134266e8e711023819abb1ca49b5..42c421ac121257a96c715cc9d3bbe4c12a9a2512 100644 (file)
@@ -1074,19 +1074,20 @@ export const LoginDialog = GObject.registerClass({
     }
 
     _notifyConflictingSessionDialogClosed(userName) {
-        const source = new MessageTray.SystemNotificationSource();
-        Main.messageTray.add(source);
-
-        this._conflictingSessionNotification = new MessageTray.Notification(source,
-            _('Stop conflicting session dialog closed'),
-            _('Try to login again to start a session for user %s.').format(userName));
-        this._conflictingSessionNotification.setUrgency(MessageTray.Urgency.CRITICAL);
-        this._conflictingSessionNotification.setTransient(true);
+        const source = new MessageTray.getSystemSource();
+
+        this._conflictingSessionNotification = new MessageTray.Notification({
+            source,
+            title: _('Stop conflicting session dialog closed'),
+            body: _('Try to login again to start a session for user %s.').format(userName),
+            urgency: MessageTray.Urgency.CRITICAL,
+            isTransient: true,
+        });
         this._conflictingSessionNotification.connect('destroy', () => {
             this._conflictingSessionNotification = null;
         });
 
-        source.showNotification(this._conflictingSessionNotification);
+        source.addNotification(this._conflictingSessionNotification);
     }
 
     _showConflictingSessionDialog(serviceName, conflictingSession) {